package CS;

public class Police extends Person {
    @Override
    public void attack(Person p) {
        if(p instanceof Fei){
            //当前对象的hp
            int t = p.getHp();
            if(((Fei)p).isSb()){
                System.out.println("恐怖分子SB");
                return;
            }
            p.setHp(
                    t - this.getAtk()
            );
        }
    }

    @Override
    public String toString() {
        return String.format("警察,HP[%d]  ATK[%d]",this.getHp(),this.getAtk());
    }
}
